with Ada.Text_Io; use Ada.Text_Io;

package body Wagons.Sdj is 
   
   function Contenance (Sdj :Wagon_Sdj) return Positive is
   begin
      return Capacite(Sdj);
   end Contenance;
   
      
   function Capacite ( Sdj : Wagon_Sdj) return Positive is
   begin
      return Sdj.Cap;
   end Capacite;
   
   function Saisir return Wagon_Sdj is 
      W: constant Wagon := Wagons.Saisir;
      Sdj : Wagon_Sdj(W.Model);
   begin
      Wagon(Sdj) := W;
      Put_Line("donnez la capacité du wagon :");
      declare 
	 Capppp : Positive := Positive'Value(Get_Line);
      begin
	 Sdj.Cap := Capppp;
	 return Sdj;
      end;
   end Saisir;
	
   procedure Afficher(Sdj : Wagon_Sdj) is
   begin
      Put_Line("WAGON SDJ");
      Afficher(Wagon(Sdj));
      Put_Line("peut accueillir "&Positive'Image(Sdj.Cap)&" enfants");
   end Afficher;
   

end Wagons.Sdj;
